package main

import (
	"net"
	"net/rpc"
)

type ClickService struct {
}

func (s *ClickService) Click(request string, reply *string) error {
	*reply = "click " + request
	return nil
}
func main() {
	//1.实例化一个Server
	listen, _ := net.Listen("tcp", ":7777")
	//2.注册处理逻辑 handler
	_ = rpc.RegisterName("ClickService", &ClickService{})
	for {
		//监听
		conn, _ := listen.Accept()
		//3.启动服务
		go rpc.ServeConn(conn)
	}

}
